import React from "react";
import { Redirect } from "react-router-dom";

function BeforeEach(props) {
  const Component = props.component;
  // 获取token
  const token = localStorage.getItem("token");
  return (
    <div className="public">
      <Component {...props} routes={props.children} />
      {/* {!token ? <Redirect to="/login" /> : ""} */}
    </div>
  );
}

export default BeforeEach;
